﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using KTXD.Entities;
using KTXD.Data;

namespace UserKTXD.TaiKhoan
{
    public partial class Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                HttpCookie cookie = Request.Cookies.Get("UserNameAndPassword");
                hienThiThongTin(cookie.Values["UserName"]);
            }
        }

        private void hienThiThongTin(string TenTruyCap)
        {
            ThanhVien entThanhVien = DataRepository.ThanhVienProvider.GetByTenTruyCap(TenTruyCap);
            txtHoTen.Text = entThanhVien.HoTen;
            txtChucVu.Text = entThanhVien.ChucVu;
            txtNgaySinh.Text = entThanhVien.NgaySinh.ToString("dd/MM/yyyy");
            txtQueQuan.Text = entThanhVien.QueQuan;
            txtDienThoai.Text = entThanhVien.SoDienThoai;
        }
    }
}